package com.winter.Controller;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.winter.model.StandardAssets;
import com.winter.service.StandardAssetsService;
import com.winter.util.Result;

@RestController
@RequestMapping("/standardAssets")
public class StandardAssetsController {

	@Resource
	private StandardAssetsService standardAssetsService;
	
	/**
     * 筛选非标以及资金平台列表信息
     * @param ien
     * @return list
     */
	@GetMapping("/getSandardAssetsList")
	public Result getSandardAssetsList( Integer pageNumber, Integer pageSize,String dcFinancingType,String assureFlg,String assureType,String userNo,String key){
		return standardAssetsService.getSandardAssetsList(pageNumber, pageSize,dcFinancingType, assureFlg, assureType,userNo,key);
	}
	
	 /**
     * 根据Id查询 发布的资金平台信息
     * @param id
     * @return
     */
    @GetMapping("/querySandardId")
    public Result querySandardId(Long id,String userNo){
    	return standardAssetsService.querySandardId(id,userNo);
    }
    
    /**
     * 新增资金平台信息
     * @param IenterpriseFinancing
     * @return int
     */
    @PostMapping("/insertStand")
    public Result insertStand(@RequestBody StandardAssets ien){
    	return standardAssetsService.insertStand(ien);
    }
    
    /**
     * 我的资产信息列表
     * @param 
     * @return 
     */
    @GetMapping("/getIenterStandList")
    public Result getIenterStandList(Integer pageNumber,Integer pageSize,String userNo){
		return standardAssetsService.getIenterStandList(pageNumber, pageSize, userNo);
    	
    }
    
    /**
     * 根据产品id和资产分类修改产品状态
     * @param 
     * @return 
     */
    @GetMapping("/getIenterStandId")
    public Result getIenterStandId(Long id,String proType,String userNo,String status){
    	
		return standardAssetsService.getIenterStandId(id,proType, userNo,status);
    	
    }
    
    /**
     * 更新资金平台非标信息
     * @param IenterpriseFinancing
     * @return int
     */
    @PostMapping("/updateStand")
    public Result updateStand(@RequestBody StandardAssets ien){
    	return standardAssetsService.updateStand(ien);
    }
    
    /**
     * 首页资产平台列表
     * @param userNo
     * @return
     */
    @GetMapping("/assets")
    public Result assetsList(){
    	return standardAssetsService.assetsList();
    }
    
}
